Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oh, snap! #6202

Merged
merged 2 commits into from
May 21, 2021
Merged

oh, snap! #6202

merged 2 commits into from
May 21, 2021

Conversation

coryschwartz
Copy link

This adds a very basic snapcraft build.

It would be possible to build and package all within snapcraft, however to avoid dealing with snapcraft plugins this would require you to build natively and simply copies the binaries into the snap.

Could be a viable solution for #6030 and to help people get up-and-running more quickly.

When reviewing, keep in mind that the version of hwloc you have installed may not be the same as the version running in, for example, the golang docker container. Ubuntu users running 18.04 have a different version than those running 20.20. This could add a complication during review as native builds may link incorrectly in the snap.

I chose to use core18 as a base with the knowledge that the golang:1.15.X docker containers have libhwloc1, not libhowloc15, available, and this is frequently the way binaries are built. However, I could be easily convinced to use core20 and updated libs instead if anyone has this preference.

building the snap:

make snap

after some time, you are given a snap file you can install.

sudo snap install --devmode ./lotus_1.8.0_amd64.snap
2021-05-06T23:21:41Z INFO Waiting for automatic snapd restart...
lotus 1.8.0 installed

proof that lotus is contained:

$ which lotus
/snap/bin/lotus
$ lotus daemon 
2021-05-06T23:23:32.443Z        INFO    main    lotus/daemon.go:214     lotus repo: /home/vagrant/snap/lotus/x1/.lotus
2021-05-06T23:23:32.443Z        INFO    repo    repo/fsrepo.go:122      Initializing repo at '/home/vagrant/snap/lotus/x1/.lotus'
2021-05-06T23:23:32.452Z        INFO    build   [email protected]/paramfetch.go:173     Fetching /var/tmp/filecoin-proof-parameters/v28-stacked-proof-of-replication-merkletree-poseidon_hasher-8-0-0-sha256_hasher-ecd683648512ab1765faa2a5f14bab48f676e633467f0aa8aad4b55dcb0652bb.vk from https://proofs.filecoin.io/ipfs/
2021-05-06T23:23:32.452Z        INFO    build   [email protected]/paramfetch.go:191     GET https://proofs.filecoin.io/ipfs/QmYCuipFyvVW1GojdMrjK1JnMobXtT4zRCZs1CGxjizs99
...
---

$ ls ~/snap/lotus/current/.lotus/
config.toml  datastore  data-transfer  heapprof  journal  keystore  kvlog  token

Of course, this snap would then be made available for everyone to use through the snap store, which could be pushed with CI by someone during releases.

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, would be great to have lotus installable through snap (we can also add .snaps to github releases)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants